50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

mvhtests (version 1.1)

Log-likelihood ratio test for equality of one covariance matrix: Log-likelihood ratio test for equality of one covariance matrix

Description

Log-likelihood ratio test for equality of one covariance matrix.

Usage

equal.cov(x, Sigma, a = 0.05)

Value

A vector with the the test statistic, the p-value, the degrees of freedom and the critical value of the test.

Arguments

x

A matrix containing Euclidean data.

Sigma

The hypothesis covariance matrix.

a

The significance level, set to 0.05 by default.

Author

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

Details

The hypothesis test is that the the sample covariance is equal to some specified covariance matrix: H0:ΣΣ=ΣΣ0, with μμ unknown. The algorithm for this test is taken from Mardia, Bibby and Kent (1979, pg. 126-127). The test is based upon the log-likelihood ratio test. The form of the test is 2logλ=ntr{ΣΣ01S}nlog|ΣΣ01S|np, where n is the sample size, ΣΣ0 is the specified covariance matrix under the null hypothesis, S is the sample covariance matrix and p is the dimensionality of the data (or the number of variables). Let α and g denote the arithmetic mean and the geometric mean respectively of the eigenvalues of ΣΣ01S, so that tr{ΣΣ01S}=pα and |ΣΣ01S|=gp, then the test statistic becomes 2logλ=np(αlog(g)1). The degrees of freedom of the χ2 distribution are 12p(p+1).

References

Mardia K.V., Kent J.T. and Bibby J.M. (1979). Multivariate Analysis. London: Academic Press.

See Also

likel.cov, Mtest.cov

Examples

Run this code
x <- as.matrix( iris[, 1:4] )
s <- cov(x) * 1.5
equal.cov(x, s)

Run the code above in your browser using DataLab